<%-- 
    Document   : CustGetOutletProfile
    Created on : Oct 3, 2011, 1:13:25 AM
    Author     : James
--%>

<%@page import="EntityState.FileState"%>
<%@page import="EntityState.OutletState"%>
<%@page import="BusinessLogic.Constants"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.List, java.util.ArrayList"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Lingua123 - Your shortcut to a new language</title>
        <link rel="stylesheet" href="../customer/main_style_sheet.css" />
        <script type="text/javascript" src="../customer/script/Utilities.js"></script>
        <script type='text/javascript' src='../jQuery/jquery-1.6.1.min.js'></script>
        <script type="text/javascript">
            <!--
            window.onload = showPage('Login', 'login_panel');

            //-->
        </script>
    </head>
    <body>
        <div id="wrapper">
            <h1>Lingua123</h1>
            <div id="nav">
                <a href="CustGetListOfPartners?action=<%= Constants.GET_LIST_OF_PARTNERS %>&id=0">Our partners</a>
                <a href="Redirect?page=search&target=ad">About Us</a>
                <a href="Redirect?page=about_us">Our Languages</a>
                <a href="Redirect?page=contact">Support</a>
            </div>
            <div id="body">
                <div id="body-top">
                    <div id="body-bot">
                        <div id="welcome">
                            <img src="../customer/images/books2.jpg" width="276" height="238" alt="Pic 1" />
                        </div>
                        <div id="login_panel"></div>
                        <div id="content">
                            <%
                                ArrayList data = (ArrayList) request.getAttribute("data");
                                int result = ((Integer) data.get(0)).intValue();
                                if (result == Constants.STATUS_SESSION_EXPIRED) {
                            %>
                            Session expired. Please login again.
                            <%
                                } else if (result == Constants.STATUS_SUCCESSFUL) {
                                    OutletState os = (OutletState) data.get(1);
                            %>
                            <table class="white">
                                <tr>
                                    <td>Name</td>
                                    <td><%= os.getName() %></td>
                                </tr>
                                <tr>
                                    <td>Address</td>
                                    <td><%= os.getAddress1() + " " + os.getAddress2() %></td>
                                </tr>
                                <tr>
                                    <td>Contact no.</td>
                                    <td><%= "(+" + os.getCountryCode() + ") " + os.getPhone() %></td>
                                </tr>
                                <tr>
                                    <td>Country</td>
                                    <td><%= os.getCountry() %></td>
                                </tr>
                                <tr>
                                    <td>Province</td>
                                    <td><%= os.getProvince() %></td>
                                </tr>
                                <tr>
                                    <td>City</td>
                                    <td><%= os.getCity() %></td>
                                </tr>
                                <tr>
                                    <td>Email</td>
                                    <td><%= os.getBusinessEmail() %></td>
                                </tr>
                                <tr>
                                    <td>Layout</td>
                                    <td><img src="<%= os.getLayout().getLocation() %>" /></td>
                                </tr>
                                <%  
                                    int i = 0;
                                    for (FileState fs : os.getListOfPictures()) {
                                %>
                                <tr>
                                    <td>Picture <%= i %></td>
                                    <td><img src="<%= fs.getLocation() %>" /><br/><%= fs.getDescription() %></td>
                                </tr>
                                <%
                                    }
                                %>
                            </table>
                            <button onclick="window.open('CustGetListOfReservableUnits?action=<%= Constants.GET_LIST_OF_RESERVABLE_UNITS %>&id=<%= os.getId() %>')">Reserve</button>
                            <%
                                }
                            %>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
